using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class TurneryMap : EntityTypeConfiguration<Turnery>
    {
        public TurneryMap()
        {
            // Primary Key
            this.HasKey(t => t.TY_ID);

            // Properties
            this.Property(t => t.TY_Name)
                .HasMaxLength(50);

            this.Property(t => t.TY_mm)
                .HasMaxLength(20);

            this.Property(t => t.TY_TargetLesion)
                .HasMaxLength(50);

            this.Property(t => t.TY_Time)
                .HasMaxLength(50);

            this.Property(t => t.TY_Ten)
                .HasMaxLength(20);

            this.Property(t => t.TY_Order)
                .HasMaxLength(20);

            this.Property(t => t.TY_SCE)
                .HasMaxLength(20);

            this.Property(t => t.TY_Remark)
                .HasMaxLength(200);

            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.OtherTargetText)
                .HasMaxLength(50);

            this.Property(t => t.TY_LesionTag)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Turnery");
            this.Property(t => t.TY_ID).HasColumnName("TY_ID");
            this.Property(t => t.TY_Name).HasColumnName("TY_Name");
            this.Property(t => t.TY_mm).HasColumnName("TY_mm");
            this.Property(t => t.TY_TargetLesion).HasColumnName("TY_TargetLesion");
            this.Property(t => t.TY_Time).HasColumnName("TY_Time");
            this.Property(t => t.TY_Ten).HasColumnName("TY_Ten");
            this.Property(t => t.TY_Order).HasColumnName("TY_Order");
            this.Property(t => t.TY_SCE).HasColumnName("TY_SCE");
            this.Property(t => t.TY_Remark).HasColumnName("TY_Remark");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.Create_Time).HasColumnName("Create_Time");
            this.Property(t => t.State).HasColumnName("State");
            this.Property(t => t.OtherTargetText).HasColumnName("OtherTargetText");
            this.Property(t => t.Target_ID).HasColumnName("Target_ID");
            this.Property(t => t.TY_NID).HasColumnName("TY_NID");
            this.Property(t => t.TY_LesionTag).HasColumnName("TY_LesionTag");
        }
    }
}
